extends ./layout

append css

append beforjs
  script(type="text/javascript", src='/js/jquery.toTop.js')

block contentAll
  a.to-top(style="cursor: pointer; position: fixed; right: 15px; bottom: 30px; display: inline;")
    i.fa.fa-arrow-circle-o-up.fa-4x
  script(type="text/javascript").
    $(()=>{
      $('.to-top').toTop();
    })
  .container
    .jumbotron(style='margin:1em 0 1em;')
      .container
        h1 Hello, world!
        h3 基于mongodb大型技术博客分享论坛的设计

block contentLeft
  .articleContent
    .contentList
      .ul.list-unstyled
        each article in articles
          //- 单个文章列表结构
          li
            a(href='articles/view/' + article.slug, target='_blank')
              h4
                =article.title
            p.contentlimit
              =truncate(article.content, 150)
            .articleinfo
              span.articleinfo-left
                span.article-userinfo
                  img.img-circle.img-responsive(src='/img/userimages/' + article.author.avatar )
                  | &nbsp;&nbsp;
                  =article.author.username
                  | &nbsp;&nbsp;
                span.article-created
                  i.fa.fa-clock-o &nbsp;
                  =moment(article.created).format('YYYY-MM-DD HH:mm:ss')
              span.articleinfo-right
                span.article-category
                  i.fa.fa-file-code-o &nbsp;
                  a(href="articles/category/"+article.category.name, target='_blank')
                    =article.category.name
                span.article-comments
                  i.fa.fa-comments-o &nbsp;&nbsp;
                  =article.comments.length || 0
                  | &nbsp;&nbsp
                span.article-meta
                  i.fa.fa-thumbs-up  &nbsp;&nbsp;
                  =article.meta.favorites || 0
                  | &nbsp;&nbsp
                span.showdatial
                  a(href='articles/view/' + article.slug, target='_blank') 查看全文
            .nofloat
      //-.box(style='height:1000px;')
      .paging(style='')
        nav(aria-label='Page navigation', style='text-align: center;margin:0 auto;"')
          ul.pagination
            li
              span
                |文章总数：
                =dataTotal
            if(pageNum > 1)
              -var prepage = pageNum-1
            else
              -var prepage = pageNum
            li   
              a(href='/articles?page=' + prepage +'&keyword='+filter.keyword, aria-label='Previous')
                span(aria-hidden='true') « 上一页
            -var pagect = 1
            while pagect <= pageCount
              if(pageNum == pagect)
                li.active
                  a(href='/articles?page=' + pagect +'&keyword='+filter.keyword)= pagect++
              else
                li
                  a(href='/articles?page=' + pagect +'&keyword='+filter.keyword)= pagect++
            if(pageNum < pageCount)
              -var aftpage = pageNum+1
            else
              -var aftpage = pageNum
            li
              a(href='/articles?page=' + aftpage +'&keyword='+filter.keyword, aria-label='Next')
                span(aria-hidden='true') 下一页 »
            li
              span
                |总页数：
                =pageCount


block contentRight
  .row
    .panel.panel-default(style='border:0; box-shadow:3px 3px 15px -10px rgba(0, 0, 0, 0.9);')
      .panel-body(style='padding-top:0;')
        h3.panel-title(style='border-bottom:1px solid rgba(0, 0, 0, 0.05);padding:8px 0;margin:0 0 5px;')
          span.glyphicon.glyphicon-triangle-right.myglyphicon(aria-hidden="true", )
          | 文章分类
        .ulcontent
          .ul.list-unstyled
            each category in categories
              li
                a(href="articles/category/"+category.name)
                  =category.name

    .panel.panel-default(style='border:0; box-shadow:3px 3px 15px -10px rgba(0, 0, 0, 0.9);')
      .panel-body(style='padding-top:0;')
        h3.panel-title(style='border-bottom:1px solid rgba(0, 0, 0, 0.05);padding:8px 0;margin:0 0 5px;')
          span.glyphicon.glyphicon-triangle-right.myglyphicon(aria-hidden="true", )
          | 友情链接
        .ulcontent
          .ul.list-unstyled
            li
              a(href="#") 南宁学院
            li
              a(href="#") 信息工程学院
            li
              a(href="#") 计算机科学与技术
            li
              a(href="#") 14计科2班


      //.list-group
      //  a.list-group-item(href="#") Cras justo odio
      //  a.list-group-item(href="#") Dapibus ac facilisis in
      //  a.list-group-item(href="#") Morbi leo risus
      //  a.list-group-item(href="#") Porta ac consectetur ac
      //  a.list-group-item(href="#") Vestibulum at eros





